package com.xunqi.blog.service;

import com.xunqi.blog.pojo.Blog;
import com.xunqi.blog.vo.BlogQuery;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;
import java.util.Map;

public interface BlogService {

    //根据id查询博客信息
    Blog getBlog(Long id);

    //分页多条件查询
    Page<Blog> listBlog(Pageable pageable, BlogQuery blog);

    Page<Blog> listBlog(Pageable pageable);

    Page<Blog> listBlog(Long tagId,Pageable pageable);

    //前台搜索
    Page<Blog> listBlog(String query,Pageable pageable);

    List<Blog> listRecommendBlogTop(Integer size);

    //归档
    Map<String,List<Blog>> archiveBlog();

    //查询有多少条博客
    Long countBlog();

    //新增信息
    Blog saveBlog(Blog blog);

    //修改信息
    Blog updateBlog(Long id,Blog blog);

    //根据id删除信息
    void deleteBlog(Long id);

}
